<!doctype html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>重置密码</title>
        <link rel="stylesheet" type="text/css" href="../css/aui.css" />
        <script src="../script/jquery.js"></script>
        <script src="../CommonTool/commonNetWork.js"></script>
    </head>
    <style>
        body {
            background-color: #03a9f4;
        }
        #frm-container {
            margin: 5px auto;
            width: 83%;
            height: 100%;
            border-radius: 20px;
            border: 2px solid white;
            padding: 5px 10px;
            background: white;
        }
    </style>
    <body>
        <div id="frm-container" class="aui-content-padded">
            <div
                class="aui-tab aui-margin-t-10 aui-margin-b-5 aui-font-size-18"
            >
                <div style="color: #03a9f4; margin: 0 auto">重置密码</div>
            </div>
            <section class="aui-content-padded">
                <div
                    class="aui-searchbar"
                    id="search"
                    style="
                        margin-bottom: 1rem;
                        background-color: #ffffff;
                        width: 100%;
                    "
                >
                    <div
                        class="aui-searchbar-input aui-border-radius"
                        style="
                            margin: 0rem;
                            height: 1.8rem;
                            border: 1px solid #459bde;
                            background-color: transparent;
                        "
                    >
                        <div
                            class="aui-iconfont aui-icon-my"
                            style="
                                width: 16px;
                                font-size: 12px;
                                margin-top: 3px;
                            "
                        ></div>
                        <div
                            style="
                                margin-top: 7px;
                                margin-right: 8px;
                                height: 21px;
                                width: 1px;
                                border-left: 1px #459bde solid;
                            "
                        ></div>
                        <input
                            style="margin-top: 3px; font-size: 0.8rem"
                            placeholder="用户名"
                            id="login_username"
                        />
                    </div>
                </div>
            </section>
            <div
                class="aui-btn aui-btn-block aui-btn-info aui-btn-sm"
                style="margin-top: 20px"
                tapmode
                onclick="reset_register();"
            >
                重置
            </div>
            <div
                class="aui-content-padded aui-hide"
                style="text-align: center"
                id="waiting_gif"
            >
                <img
                    src="../../image/loading_more.gif"
                    style="width: 20px; height: 20px"
                    class="aui-inline"
                />
            </div>
            <div
                class="aui-font-size-30"
                style="text-align: center; margin-top: 0.5rem; color: #459bde"
                onclick="Direct_entry();"
            >
                返回登录
            </div>
        </div>
    </body>
    <script type="text/javascript" src="../script/api.js"></script>
    <script>
        function reset_register() {
            var usercode = document.getElementById("login_username").value;
            $.ajax({
                url: CommonUrl + "/tSysUser/initializePassword",
                method: "post",
                dataType: "json",
                contentType: "application/json",
                // contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
                data: JSON.stringify({
                    code: document.getElementById("login_username").value,
                }),
                success: function (data) {
                    alert(JSON.parse(JSON.stringify(data.data)));
                },
                error: function (error) {
                    alert(JSON.parse(JSON.stringify(error.data)));
                },
            });
        }
        function Direct_entry() {
            api.openWin({
                name: "login",
                url: "./login.html",
            });
        }
    </script>
</html>
